<template>
  <el-menu
    class="el-menu-vertical-demo"
    background-color="#324157"
    text-color="#fff"
    active-text-color="#20A0FF"
    >

    <template v-for="(n, i) in noveList">
      <el-menu-item :index="i + ''" v-if="n.type === userType" @click="jump(n.path)">
        <i :class="n.icon"></i>
        <span slot="title">{{ n.name }}</span>
      </el-menu-item>
    </template>

  </el-menu>
</template>

<script>
import {nove} from "../../common/Nove";

export default {
  name: "Side",
  data() {
    return {
      userType: this.$store.getters.getUser.type,
      noveList: []
    }
  },
  methods: {
    jump(path) {
      this.$router.push({name: path})
    }
  },
  mounted() {
    this.noveList = nove;
  }
}
</script>

<style scoped>
.el-menu-vertical-demo {
  background-color: rgb(50, 65, 87);
}
</style>
